﻿using System;

namespace down2.db
{
    public partial class d_update : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string fid    = Request.QueryString["id"];
            string uid    = Request.QueryString["uid"];
            string per    = Request.QueryString["perLoc"];
            string lenLoc = Request.QueryString["lenLoc"];
            string lenSvr = Request.QueryString["lenSvr"];
            string sizeSvr = Request.QueryString["sizeSvr"];
            string nameLoc = Server.UrlDecode(Request.QueryString["nameLoc"]);
            string pathLoc = Server.UrlDecode(Request.QueryString["pathLoc"]);
            string cbk    = Request.QueryString["callback"];

            if (   string.IsNullOrEmpty(uid)
                || string.IsNullOrEmpty(fid)
                || string.IsNullOrEmpty(cbk)
                )
            {
                Response.Write(cbk+"({\"value\":null})");
                Response.End();
                return;
            }
            if (string.IsNullOrEmpty(lenLoc)) lenLoc = "0";
            if (string.IsNullOrEmpty(lenSvr)) lenSvr = "0";

            DnFile db = new DnFile();
            db.update(fid, int.Parse(uid), lenLoc, per,nameLoc,pathLoc,lenSvr,sizeSvr);
            Response.Write(cbk + "({\"value\":1})");
        }
    }
}